<?php
$this->breadcrumbs=array(
    Yii::t('site','Posts'),
);

$this->menu=array(
    array('label'=>Yii::t('site','Create New Post'), 'url'=>array('create'), 'visible'=>Yii::app()->user->checkAccess('admin')),
    array('label'=>Yii::t('site','Manage Posts'), 'url'=>array('admin'), 'visible'=>Yii::app()->user->checkAccess('admin')),
);
?>

<?php if(isset($_GET['archive'])): ?>
<div align="right">
    <?php echo CHtml::link(Yii::t('site','Show current posts'),array('/post/index')); ?>
</div>
<h1><?php echo CHtml::encode(Yii::t('site','Archived Posts')); ?></h1>
<?php else : ?>
<div align="right">
    <?php echo CHtml::link(Yii::t('site','Show archived posts'),array('/post/index','archive'=>1)); ?>
</div>
<h1><?php echo CHtml::encode(Yii::t('site','Current Posts')); ?></h1>
<?php endif; ?>

<?php if(!empty($_GET['tag'])): ?>
<div align="right">
    <?php echo CHtml::link(Yii::t('site','Show all posts'),array('/post/index')); ?>
</div>
<h2><?php echo CHtml::encode(Yii::t('site','Posts Tagged with {tag}',array('{tag}'=>$_GET['tag']))); ?></h2>
<?php endif; ?>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
	'template'=>"{items}\n{pager}",
)); ?>
